package edu.sctu.practice.class02.Wangpeng.Test3;

/**
 * Created by wp on 2015/11/9.
 */
public class MyTime {
    private int hour;
    private int minute;
    private int second;

    public MyTime(int hour,int minute,int second){
        this.hour=hour;
        this.minute=minute;
        this.second=second;
    }

    void display(){
        System.out.println("时间"+hour+":"+minute+":"+second);
    }
    void addSecond(int sec){
        second=second+sec;
    }
    void addMinute(int min){
        minute=minute+min;
    }
    void addHour(int hou){
        hou=hou+hou;
    }
    void subSecond(int sec){
        second=second-sec;
    }
    void subMinute(int min){
        minute=minute-min;
    }
    void subHour(int hou){
        hou=hour-hou;
    }

    void Test(){
        if(hour<=23&hour>=0&minute<=59&minute>=0&second<=59&second>=0)
            System.out.println("True");
        else
            System.out.println("False");
    }
}
